<template>
    <div>
        <el-bread></el-bread>
        <el-button type="primary" size="mini" class="btn" @click="add">添加</el-button>
        <v-list @edit="edit"></v-list>
        <v-dialog :isShow="isShow" :isAdd="isAdd" @close="close" ref="dialogRef"></v-dialog>
    </div>
</template>
<script>
import vList from "./list.vue"
import vDialog from "./dialog.vue"
export default {
    data() {
        return {
            isShow: false,
            isAdd: true
        }
    },
    methods: {
        add() {
            this.isShow = true
            this.isAdd = true
        },
        close(){
            this.isShow = false
        },
        edit(id){
            this.isShow = true
            this.isAdd = false
            this.$refs.dialogRef.lookup(id)
        } 

        

    },
    mounted() { },
    watch: {},
    computed: {},
    filters: {},
    components: {
        vList,
        vDialog
    }
}
</script>
<style scoped>
.btn {
    margin: 20px;
    margin-left: 0;
}
</style>